<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>金字塔</title>
    <style>
        body{
            text-align: center;
        }
    </style>
</head>
<body>
<script>
    for (var a=0;a<15;a++){
        for (var j=15;j<10-a-1;j++){
            document.write("&nbsp")
        }
        for (k=0;k<a*2+1;k++){
            document.write("*")
        }
            document.write("<br>")
    }
</script>
</body>
</html>